package com.company;

import java.io.*;

/**
 * Created by asus on 2017/8/25.
 */
public class StroringAndRecoveringData {
    public static void main (String [] args) throws IOException{
        DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream("Data.txt")));
        out.writeDouble(3.1);
        out.writeUTF("This w");
        out.writeDouble(1.1);
        out.writeUTF("aaa");
        out.close();
        DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream("Data.txt")));
        System.out.println(in.readDouble());
        System.out.println(in.readUTF());
        System.out.println(in.readDouble());
        System.out.println(in.readUTF());
    }
}
